@echo off

SETLOCAL ENABLEDELAYEDEXPANSION

set uz_tool="D:\Program Files (x86)\7-Zip\7z.exe"
set ws_base=E:\hengsheng\workspace_big_v\trunk\Sources\app\ifs-full\ifs-platform-dav

if not defined ws_base (
set ws_base="%~dp0"
)

set site_type=%1

goto !site_type!

echo error_arg
pause

:ua
set prj_name=ifs-platform-dav-uag
set rel_prj_path=%prj_name%
goto toStart

:cf
set prj_name=ifs-platform-dav-configure
set rel_prj_path=%prj_name%
goto toStart

:api
set prj_name=ifs-platform-dav-middle
set rel_prj_path=%prj_name%
goto toStart

:toStart
set dir_bk=%cd%

echo starting !site_type!

echo %ws_base%\%rel_prj_path%\target
cd %ws_base%\%rel_prj_path%\target
cd %prj_name%*\bin
if !errorlevel! neq 0 (
if exist %prj_name%*.tar.gz (
%uz_tool% x %prj_name%*.tar.gz
%uz_tool% x %prj_name%*.tar
del %prj_name%*.tar
cd %prj_name%*\bin
)
)

start "!site_type!" start.bat debug

cd %dir_bk%




:eof
ENDLOCAL

pause